package com.anycl.design.creation.singleton;

/**
 * 懒汉式
 */
public class Singleton {

    private static volatile Singleton instance = null;

    private Singleton() {
    }

    public static synchronized Singleton getInstance() {
        if (instance == null)
            instance = new Singleton();
        return instance;
    }
}
